#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <iterator>
#include <ctime>
#include <windows.h>
#include <algorithm>
#include <cstdlib>


using namespace std;

struct Node{
	int value;
	Node* left;
	Node* right;
};

void merge_BStree(Node* lhs, Node* rhs);
struct status{

	status():from(NULL) {}
	int v[3];
	status* from;
};

void pre_order_traversal_no_rec(Node* root);
void test_4_22();
bool digit_test(int,int);
bool is_huiwen(int,int);
bool is_d_huiwen(int num);
bool is_prime(int num);
void test();
bool post_order_verify(int *);

void prime_table(int num,vector<bool>& isp);
void print_prime_circle(int, int, int*, vector<bool>&, const vector<bool>&);


void print_permutation(int n,int* A,int cur, int& count);
void print_subset(int,int*,int,int*);
void print_subset(int,int*,int*,int);
void subset_fanwai(int,int,int*,int*);
void chess_print(const vector<int>&,int);
void queen_8(int,int,vector<int>&);
void match_fanwai();
void match_recursion(int,int,int,vector<int>&);

void pro_7_1_1();
void pro_7_1_2();
void pro_7_1_3();
void pro_7_1_4();
void pro_7_2_1();
void pro_7_2_2();
void pro_7_3_1();
void pro_7_3_2();
void prof_zhang();
void pro_7_4_1();
void pro_7_4_2();
void pro_7_5_2();

void inner_program(const vector<int>&,int,vector<bool>&);
void print_path(status* cur);

void six_100();

void chess_board(int, int, int, int, int, vector<int>&);
void pro_8_3_1();
